package cn.rmc.hrm.feignfallback;

import cn.rmc.hrm.doc.CourseDoc;
import cn.rmc.hrm.feign.CourseFeign;
import cn.rmc.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFeignFallback implements FallbackFactory<CourseFeign> {
    @Override
    public CourseFeign create(Throwable throwable) {
        return new CourseFeign() {
            @Override
            public AjaxResult save(CourseDoc courseDoc) {
                return AjaxResult.me().setSuccess(false).setMessage("我是兜底函数");
            }
        };
    }
}
